package enregistrement;

import java.util.ArrayList;

import command.Command;

public class Enregistreur {

	private ArrayList<Command> listCommand;

	private ArrayList<Memento> listMemento;

	private boolean etat;

	public Enregistreur() {
		listMemento = new ArrayList<Memento>();
		listCommand = new ArrayList<Command>();
		etat = false;
	}

	public void setEtat(boolean etat) {
		this.etat = etat;

	}

	public boolean getEtat() {
		return etat;
	}

	public void ajouterCommand(Memento memento) {
		Command command = memento.getCommand();
		listMemento.add(memento);
		listCommand.add(command);
	}

	public ArrayList<Command> getCommandList() {
		return listCommand;
	}

	public void effacerListe() {
		listMemento.clear();
		listCommand.clear();
	}

	public int getListSize() {
		return listMemento.size();
	}

	public ArrayList<Memento> getMementoList() {
		return listMemento;
	}

	public void setMemento() {

	}

	public Memento lastAction() {
		return this.listMemento.get(listMemento.size() - 2);
	}

}
